var express = require("express"),
    gossip = require("../../models/adminSite/gossip"),
    gossip = new gossip(),
    gossipData = "",
	router = express.Router(),
	getGossip = function(req , res , next){
		gossip.getGossip({conditions : {isShow : 0} , page : req.body.page} , function(error , data){
			if(error){
				return res.end("<h2>操作失败</h2>");
			};
			(gossipData = data) && next();
		});
	};
router.get("/gossip" , getGossip , function(req , res){
	res.render("webSite/gossip" , {
		gossip : gossipData,
		user : req.session.user
	})
});

//接口
module.exports = router;
